<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    x:Class="OpenLS.Chart.UI.UnitResources"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
    xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
    xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals">
    <ResourceDictionary.MergedDictionaries>
        <chartui:EnumResources/>
    </ResourceDictionary.MergedDictionaries>
    <DataTemplate DataType="{x:Type chart:BuiltInUnit}">
        <ContentPresenter Content="{Binding Value}" />
    </DataTemplate>
    <DataTemplate DataType="{x:Type chart:CustomUnit}">
        <TextBlock Text="{Binding Value}" Name="tb" />
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=Value}" Value="1">
                <Setter TargetName="tb" Property="Text" Value="{x:Static Internals:UIStringTable.NoUnit}"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate DataType="{x:Type chart:DisplayUnits}">
        <Grid Name="grid" HorizontalAlignment="Right" VerticalAlignment="Top">
        <ContentPresenter Content="{Binding Unit}" Name="cp">
            <ContentPresenter.LayoutTransform>
                <RotateTransform Angle="{Binding ElementName=grid,Path=DataContext.Label.TextProperties.BodyProperties.Rotation}"/>
            </ContentPresenter.LayoutTransform>
        </ContentPresenter>
            </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Label}" Value="{x:Null}">
                <Setter Property="Content" TargetName="cp" Value="{x:Null}"></Setter>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>